import { requestAjax } from './http'

export function getPubAdminLoginInfo(params?: any) {
  const res = {
    "code": 200,
    "status": 200,
    "data": {
        "_id": "6866ca4c5f76e9cdf87ffb23",
        "name": "test1",
        "code": "test1",
        "nickname": "用户1",
        "email": "xx@126.com",
        "pictureUrl": "https://vxeui.com/resource/img/bq673.gif",
        "roleCode": "userAdmin",
        "roleName": "用户管理员",
        "roleLevel": 5,
        "roleList": [
            {
                "label": "用户管理员",
                "value": "userAdmin",
                "level": 5
            },
            {
                "label": "普通用户",
                "value": "default",
                "level": 100
            }
        ],
        "routeList": [
            {
                "name": "首页",
                "code": "homeList",
                "parentCode": null,
                "routeName": "HomeList",
                "type": "menu",
                "icon": "vxe-icon-home",
                "sort": 100
            },
            {
                "name": "示例一（编辑模式）",
                "code": "demoOne",
                "parentCode": null,
                "routeName": "",
                "type": "menu",
                "icon": "vxe-icon-feedback",
                "sort": 10000
            },
            {
                "name": "示例二（页面模式）",
                "code": "demoTwo",
                "parentCode": null,
                "routeName": "",
                "type": "menu",
                "icon": "vxe-icon-feedback",
                "sort": 10000
            },
            {
                "name": "示例三（弹窗模式）",
                "code": "demoThree",
                "parentCode": null,
                "routeName": "",
                "type": "menu",
                "icon": "vxe-icon-feedback",
                "sort": 10000
            },
            {
                "name": "示例四（抽屉模式）",
                "code": "demoFour",
                "parentCode": null,
                "routeName": "",
                "type": "menu",
                "icon": "vxe-icon-feedback",
                "sort": 10000
            },
            {
                "name": "列表",
                "code": "demoOneList",
                "parentCode": "demoOne",
                "routeName": "DemoOneList",
                "type": "menu",
                "icon": "",
                "sort": 10100
            },
            {
                "name": "列表",
                "code": "demoTwoList",
                "parentCode": "demoTwo",
                "routeName": "DemoTwoList",
                "type": "menu",
                "icon": "",
                "sort": 10200
            },
            {
                "name": "列表",
                "code": "demoThreeList",
                "parentCode": "demoThree",
                "routeName": "DemoThreeList",
                "type": "menu",
                "icon": "",
                "sort": 10200
            },
            {
                "name": "列表",
                "code": "demoFourList",
                "parentCode": "demoFour",
                "routeName": "DemoFourList",
                "type": "menu",
                "icon": "",
                "sort": 10200
            },
            {
                "name": "用户管理",
                "code": "userManageList",
                "parentCode": "systemManage",
                "routeName": "UserManageList",
                "type": "menu",
                "icon": "",
                "sort": 20100
            },
            {
                "name": "角色管理",
                "code": "roleManageList",
                "parentCode": "systemManage",
                "routeName": "RoleManageList",
                "type": "menu",
                "icon": "",
                "sort": 20200
            },
            {
                "name": "新增",
                "code": "demoOneActionInsert",
                "parentCode": "demoOneList",
                "routeName": "",
                "type": "action",
                "icon": "",
                "sort": 20201
            },
            {
                "name": "新增",
                "code": "DemoTwoAdd",
                "parentCode": "demoTwoList",
                "routeName": "DemoTwoAdd",
                "type": "action",
                "icon": "",
                "sort": 20201
            },
            {
                "name": "新增",
                "code": "demoThreeActionInsert",
                "parentCode": "demoThreeList",
                "routeName": "",
                "type": "action",
                "icon": "",
                "sort": 20201
            },
            {
                "name": "新增",
                "code": "demoFourActionInsert",
                "parentCode": "demoFourList",
                "routeName": "",
                "type": "action",
                "icon": "",
                "sort": 20201
            },
            {
                "name": "新增",
                "code": "userManageActionInsert",
                "parentCode": "userManageList",
                "routeName": "",
                "type": "action",
                "icon": "",
                "sort": 20201
            },
            {
                "name": "删除",
                "code": "demoOneActionDelete",
                "parentCode": "demoOneList",
                "routeName": "",
                "type": "action",
                "icon": "",
                "sort": 20202
            },
            {
                "name": "删除",
                "code": "demoTwoActionDelete",
                "parentCode": "demoTwoList",
                "routeName": "",
                "type": "action",
                "icon": "",
                "sort": 20202
            },
            {
                "name": "删除",
                "code": "demoThreeActionDelete",
                "parentCode": "demoThreeList",
                "routeName": "",
                "type": "action",
                "icon": "",
                "sort": 20202
            },
            {
                "name": "删除",
                "code": "demoFourActionDelete",
                "parentCode": "demoFourList",
                "routeName": "",
                "type": "action",
                "icon": "",
                "sort": 20202
            },
            {
                "name": "删除",
                "code": "userManageActionDelete",
                "parentCode": "userManageList",
                "routeName": "",
                "type": "action",
                "icon": "",
                "sort": 20202
            },
            {
                "name": "编辑",
                "code": "demoOneActionUpdate",
                "parentCode": "demoOneList",
                "routeName": "",
                "type": "action",
                "icon": "",
                "sort": 20203
            },
            {
                "name": "编辑",
                "code": "DemoTwoEdit",
                "parentCode": "demoTwoList",
                "routeName": "DemoTwoEdit",
                "type": "action",
                "icon": "",
                "sort": 20203
            },
            {
                "name": "编辑",
                "code": "demoThreeActionUpdate",
                "parentCode": "demoThreeList",
                "routeName": "",
                "type": "action",
                "icon": "",
                "sort": 20203
            },
            {
                "name": "编辑",
                "code": "demoFourActionUpdate",
                "parentCode": "demoFourList",
                "routeName": "",
                "type": "action",
                "icon": "",
                "sort": 20203
            },
            {
                "name": "编辑",
                "code": "userManageActionUpdate",
                "parentCode": "userManageList",
                "routeName": "",
                "type": "action",
                "icon": "",
                "sort": 20203
            },
            {
                "name": "详情",
                "code": "DemoOneDetails",
                "parentCode": "demoOneList",
                "routeName": "DemoOneDetails",
                "type": "action",
                "icon": "",
                "sort": 20204
            },
            {
                "name": "详情",
                "code": "DemoTwoDetails",
                "parentCode": "demoTwoList",
                "routeName": "DemoTwoDetails",
                "type": "action",
                "icon": "",
                "sort": 20204
            },
            {
                "name": "详情",
                "code": "demoThreeActionView",
                "parentCode": "demoThreeList",
                "routeName": "",
                "type": "action",
                "icon": "",
                "sort": 20204
            },
            {
                "name": "详情",
                "code": "demoFourActionView",
                "parentCode": "demoFourList",
                "routeName": "",
                "type": "action",
                "icon": "",
                "sort": 20204
            },
            {
                "name": "权限管理",
                "code": "permissionsManageList",
                "parentCode": "systemManage",
                "routeName": "PermissionsManageList",
                "type": "menu",
                "icon": "",
                "sort": 20300
            },
            {
                "name": "路由管理",
                "code": "routeManageList",
                "parentCode": "systemManage",
                "routeName": "RouteManageList",
                "type": "menu",
                "icon": "",
                "sort": 20400
            },
            {
                "name": "数据字典",
                "code": "dictManageList",
                "parentCode": "systemManage",
                "routeName": "DictManageList",
                "type": "menu",
                "icon": "",
                "sort": 20500
            },
            {
                "name": "数据配置",
                "code": "dictDataList",
                "parentCode": "dictManageList",
                "routeName": "DictDataList",
                "type": "action",
                "icon": "",
                "sort": 20501
            },
            {
                "name": "系统日志",
                "code": "logManageList",
                "parentCode": "systemManage",
                "routeName": "LogManageList",
                "type": "menu",
                "icon": "",
                "sort": 20600
            },
            {
                "name": "系统管理",
                "code": "systemManage",
                "parentCode": null,
                "routeName": "",
                "type": "menu",
                "icon": "vxe-icon-setting",
                "sort": 30000
            },
            {
                "name": "关于我们",
                "code": "aboutUs",
                "parentCode": null,
                "routeName": "AboutUs",
                "type": "menu",
                "icon": "vxe-icon-chat",
                "sort": 100000
            }
        ]
    },
    "msg": ""
}
  return Promise.resolve(res);
  // return requestAjax({
  //   url: '/api/pub/admin/login/info',
  //   method: 'get',
  //   params
  // })
}

export function postPubAdminLoginValid(data?: any) {
  // const res = {
  //   "code": 200,
  //   "status": 200,
  //   "data": {
  //     "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyTmFtZSI6InRlc3QxIiwiaWF0IjoxNzQzNDExNTE0LCJleHAiOjE3NDM0OTc5MTR9.XZEu9AaK0BPsDWN2htzA6FvDzU61ZclnBRdrEpHhYmg",
  //     "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyTmFtZSI6InRlc3QxIiwiaWF0IjoxNzQzNDExNTE0LCJleHAiOjE3NDQwMTYzMTR9.8SbrauUfDfxSkVXv3SCfCcALjVBUTY9oTcAGPwn44pk"
  //   },
  //   "msg": ""
  // };
  // return Promise.resolve(res);

  // return requestAjax({
  //   url: '/api/pub/admin/login/valid',
  //   method: 'post',
  //   data
  // }) 

  return requestAjax.post('/api/pub/admin/login/valid', data)
}

export function postPubAdminLoginRegister(data?: any) {
  return requestAjax({
    url: '/api/pub/admin/login/register',
    method: 'post',
    data
  })
}

export function postPubAdminLogout(data?: any) {
  return requestAjax({
    url: '/api/pub/admin/logout',
    method: 'post',
    data
  })
}
